-
Notifications
You must be signed in to change notification settings - Fork 136
Fix UI flickering when fetching bookings for the first time #14800
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix UI flickering when fetching bookings for the first time #14800
Conversation
Add a new `replaceAllForSite` transactional function to the `BookingsDao`. This function first deletes all bookings for a given site and then inserts the new list of bookings, ensuring atomicity.
The `deleteAllForSite` and `insertOrReplace` calls are replaced with a single `replaceAllForSite` call. This is done within a database transaction, making the operation more efficient.
📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
|
|
📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## trunk #14800 +/- ##
============================================
- Coverage 38.15% 38.15% -0.01%
+ Complexity 10059 10058 -1
============================================
Files 2129 2129
Lines 120211 120215 +4
Branches 16439 16439
============================================
- Hits 45867 45864 -3
- Misses 69721 69727 +6
- Partials 4623 4624 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
AdamGrzybkowski
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good find @irfano 🔥
Closes WOOMOB-1559
Description
When fetching the first page of the bookings list, we were deleting existing bookings and inserting new ones in two separate database transactions. This caused the UI to briefly display an empty list, resulting in flickering. This PR combines these two operations into a single transaction to resolve the issue.
Steps to reproduce
The tests that have been performed
Steps above
Images/gif
RELEASE-NOTES.txtif necessary. Use the "[Internal]" label for non-user-facing changes.